package com.softer.wxzj.controller;

import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.entity.ExpPublic;
import com.softer.wxzj.service.ExpPublicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Gong Zhiyang
 * @date 2020/7/28
 */
@RequestMapping("/expPublic")
@RestController
public class ExpPublicController {
    @Autowired
    private ExpPublicService expPublicService;

    /**
     * 新增应急公示
     *
     * @param expPublic 公示信息
     * @return 新增结果
     */
    @PostMapping("/add")
    public CommonResult add(@RequestBody ExpPublic expPublic) {
        return expPublicService.add(expPublic);
    }

    /**
     * 查询应急公示信息
     *
     * @param projectId 项目ID
     * @param arcType 图档类型
     * @return 公示信息
     */
    @PostMapping("/getInfo")
    public ExpPublic getInfo(String projectId, String arcType) {
        return expPublicService.getInfo(projectId, arcType);
    }
}
